<script setup lang="ts">
import { DetectionJoin } from '@/axios/API.ts'
import useUserInfoStore from '@/pinia/userInfo.ts'

onMounted(() => {
  console.log(useUserInfoStore().user.count)
  useUserInfoStore().user.count = 100
  DetectionJoin().then((res) => {
    console.log(res)
    useToast().success(res.message)
  })
})
</script>

<template>
  <div>
    <a href="https://vitejs.dev" target="_blank">
      <img src="@/assets/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="@/assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <h1>{{ 'VITE+TS+VUE3' }}</h1>

  <div class="card">
    <button type="button" @click="useUserInfoStore().user.count++">count is {{ useUserInfoStore().user.count }}</button>
    <p>
      Edit
      <code>views/Home.vue</code> to test HMR
    </p>
  </div>

  <p>
    Check out
    <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite starter
  </p>
  <p>
    Install
    <a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
    in your IDE for a better DX
  </p>
  <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>

<style scoped lang="scss">
.read-the-docs {
  color: $testColor;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
